package joc.contract;

import joc.customize.Contract;
import joc.customize.PartialEvaluationResult;
import joc.customize.ForFieldEvaluateAtBeginningOfAllMethods;
import joc.customize.ForFieldEvaluateAtEndOfAllBehaviors;
import joc.customize.ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit;
import joc.customize.ForParameterEvaluateAtBeginningOfBehavior;

public class NotNullContract extends Contract<NotNull> {
	@ForFieldEvaluateAtBeginningOfAllMethods
	@ForFieldEvaluateAtEndOfAllBehaviors
	@ForParameterEvaluateAtBeginningOfBehavior
	@ForMethodEvaluateAtEndOfMethodWithReturnValueAndInherit
	public PartialEvaluationResult checkContract(NotNull annotation, Object value) {
		return getResult(value != null, "Object is null.");
	}
}
